package com.dwjm.util;


/**
 * 
 * 导出表格工具类
 * 
 * @author luans
 *
 */
public class OutExcelSynthesize {

	/**
	 *  导出普通用户Excel
	 * @param os
	 * @param list
	 * @param fname
	 * @throws Exception
	 * @author luans
	 *//*
	public void createsingleExcel(OutputStream os, List<User> list, String fname)
			throws Exception {
		WritableFont fontTitle = new WritableFont(WritableFont.TIMES, 9,
				WritableFont.NO_BOLD);
		fontTitle.setColour(jxl.format.Colour.RED);
		WritableCellFormat formatTitle = new WritableCellFormat(fontTitle);
		formatTitle.setWrap(true);
		// 创建工作薄
		WritableWorkbook workbook = Workbook.createWorkbook(os);

		// fname = new String(fname.getBytes("ISO-8859-1"), "utf-8");
		// 创建新的一页
		WritableSheet sheet = workbook.createSheet(fname, 0);

		// 创建要显示的内容,创建一个单元格，第一个参数为列坐标，第二个参数为行坐标，第三个参数为内容
		// 创建第一行
		Label from = new Label(0, 0, "来源");
		sheet.addCell(from);
		Label id = new Label(1, 0, "用户编号");
		sheet.addCell(id);
		Label name = new Label(2, 0, "用户名");
		sheet.addCell(name);
		Label email = new Label(3, 0, "邮箱");
		sheet.addCell(email);
		Label phone = new Label(4, 0, "电话");
		sheet.addCell(phone);
		Label realname = new Label(5, 0, "真实姓名");
		sheet.addCell(realname);
		Label address = new Label(6, 0, "所在地");
		sheet.addCell(address);
		User user = new User();
		String fromtext = "微信";
		// 标题下的内容
		for (int i = 0; i < list.size(); i++) {// 行
			user = list.get(i);
			if (user.getWxOpenid() == null || "".equals(user.getWxpOpenid())) {
				fromtext = "平台";
			} else {
				fromtext = "微信";
			}
			Label from2 = new Label(0, i + 1, fromtext);
			sheet.addCell(from2);
			Label id2 = new Label(1, i + 1, user.getUid() + "");
			sheet.addCell(id2);
			Label name2 = new Label(2, i + 1, user.getUsername());
			sheet.addCell(name2);
			Label email2 = new Label(3, i + 1, user.getEmail());
			sheet.addCell(email2);
			Label phone2 = new Label(4, i + 1, user.getPhone());
			sheet.addCell(phone2);
			Label realname2 = new Label(5, i + 1, user.getRealname());
			sheet.addCell(realname2);
			Label address2 = new Label(6, i + 1, user.getAddress());
			sheet.addCell(address2);

		}

		// 把创建的内容写入到输出流中，并关闭输出流
		workbook.write();
		workbook.close();
		os.close();
	}
*/

}
